package edu.zut.cs.javaee.manager.student.domain;
/**
 * 
 * @author weining
 *
 */
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;



import edu.zut.cs.javaee.manager.base.domain.BaseTreeEntity;

@Entity
@Table(name = "T_STUDENT_MONITOR")
@NamedQueries({@NamedQuery(name="Monitor.getRoot",query = "select m from Monitor m where m.parent is null")})
public class Monitor extends BaseTreeEntity<Monitor, Long>{

	/**
	 * 
	 */
	private static final long serialVersionUID = -4618410164767747588L;
	
	@Column
	String code;
	@Column
	String name;
	

	@ManyToOne
	@JoinColumn(name="STUDENT_MONITOR_ID")
	Student student;
	
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
